//
//  GYNetWorkTools.m
//  GoodLuck
//
//  Created by apple on 2018/2/26.
//  Copyright © 2018年 yunjiazhineng. All rights reserved.
//


static NSString *baseURLString = @"https://youwei.yunhongkg.com/appapi/";//https://youwei.yunhongkg.com

#import "GYNetWorkTools.h"
#import <AFNetworking.h>
#import "GYUser.h"



@implementation GYNetWorkTools


/**
 创建一个请求对象
 
 @return <#return value description#>
 */
+ (AFHTTPSessionManager *)Manager {//http://119.29.88.192:8080
    
    AFHTTPSessionManager *manager = [[AFHTTPSessionManager alloc] initWithBaseURL:[NSURL URLWithString:baseURLString]];
    [manager setResponseSerializer:[AFHTTPResponseSerializer serializer]];
    [manager setSecurityPolicy:[self customSecurityPolicy]];
    
    return manager;
}

+ (AFSecurityPolicy*)customSecurityPolicy
{
    // /先导入证书 (要记得把证书添加到程序中)
    NSString *cerPath = [[NSBundle mainBundle] pathForResource:@"https" ofType:@"cer"];//证书的路径
    
    //NSLog(@"filepath ========%@",cerPath);
    NSData *certData = [NSData dataWithContentsOfFile:cerPath];
    
    // AFSSLPinningModeCertificate 使用证书验证模式
    AFSecurityPolicy *securityPolicy = [AFSecurityPolicy policyWithPinningMode:AFSSLPinningModeCertificate];
    
    securityPolicy.allowInvalidCertificates = YES;
    
    securityPolicy.validatesDomainName = NO;
    securityPolicy.pinnedCertificates = [NSSet setWithObject:certData];
    
    
    return securityPolicy;
}

+ (void)POST:(NSString *)url parameters:(id)dic success:(SuccessCallBack)successCallBack error:(ErrorCallBlck)errorCallBack {
    [[self Manager] POST:url parameters:dic progress:nil success:^(NSURLSessionDataTask * _Nonnull task, id  _Nullable responseObject) {
        NSDictionary *dic = [NSJSONSerialization JSONObjectWithData:responseObject options:NSJSONReadingMutableLeaves error:nil];
        //1.我们要判断 请求是否返回code 401   然后 判断是否有字段login字段
        int code = [[dic objectForKey:@"code"] intValue];
        //NSLog(@"code=========%d",code);
        //判断是否是401
        if (code == 401) {
            [EasyLodingView hidenLoingInView:[UIApplication sharedApplication].keyWindow];
            //3.删除储存的个人信息
            [GYUser removeUserInfo];

            //发送用户重新登陆的通知
            [[NSNotificationCenter defaultCenter]postNotificationName:userAgainLanding object:nil];
            
            //3.提示用户账号可能在其他地方登录 要求重新登陆
            [EasyTextView showText:[dic objectForKey:@"msg"]];
            
        }
        successCallBack(dic);
        
    } failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {
        errorCallBack(error);
    }];
}

+ (void)GET:(NSString *)url parameters:(id)dic success:(SuccessCallBack)successCallBack error:(ErrorCallBlck)errorCallBack {
    [[self Manager]GET:url parameters:dic progress:nil success:^(NSURLSessionDataTask * _Nonnull task, id  _Nullable responseObject) {
        NSDictionary *dic = [NSJSONSerialization JSONObjectWithData:responseObject options:NSJSONReadingMutableLeaves error:nil];
        //1.我们要判断 请求是返回code 401   然后 判断是否有字段login字段
        int code = [[dic objectForKey:@"code"] intValue];
        //判断是否是401
        if (code == 401) {
            [EasyLodingView hidenLoingInView:[UIApplication sharedApplication].keyWindow];
            //3.删除储存的个人信息
            [GYUser removeUserInfo];
            
            //发送用户重新登陆的通知
            [[NSNotificationCenter defaultCenter]postNotificationName:userAgainLanding object:nil];

            //3.提示用户账号可能在其他地方登录 要求重新登陆
            [EasyTextView showText:[dic objectForKey:@"msg"]];
        }
        successCallBack(dic);
    } failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {
        errorCallBack(error);
    }];
}

#pragma mark -- 登陆注册

+ (void)requestUserLogin:(NSString *)userName password:(NSString *)password success:(SuccessCallBack)successCallBack error:(ErrorCallBlck)errorCallBack {
    NSString *url = @"index.php?act=login";
    NSDictionary *dic = @{@"username":userName,@"password":password,@"client":@"app"};
    
    [self POST:url parameters:dic success:successCallBack error:errorCallBack];
}

+ (void)requestUserRegister:(NSString *)user_name password:(NSString *)password password_confirm:(NSString *)password_confirm province_id:(NSString *)province_id city_id:(NSString *)city_id area_id:(NSString *)area_id phone:(NSString *)phone area_info:(NSString *)area_info sms_code:(NSString *)sms_code inviter_code:(NSString *)inviter_code success:(SuccessCallBack)successCallBack error:(ErrorCallBlck)errorCallBack {
    
    NSString *url = @"index.php?act=login&op=register";
    NSDictionary *dic = @{@"user_name":user_name,
                          @"password":password,
                          @"password_confirm":password_confirm,
                          @"province_id":province_id,
                          @"city_id":city_id,
                          @"area_id":area_id,
                          @"phone":phone,
                          @"area_info":area_info,
                          @"sms_code":sms_code,
                          @"inviter_code":inviter_code,
                          @"client":@"app"
                          };
    
    //3.发送一个post请求
    [self POST:url parameters:dic success:successCallBack error:errorCallBack];
}

+ (void)requestUserSignOut:(SuccessCallBack)successCallBack error:(ErrorCallBlck)errorCallBack {
    NSString *url = @"index.php?act=logout";
    NSDictionary *dic = @{@"key":[[GYUser loadUserInfo] key] == nil ? @"" : [[GYUser loadUserInfo] key],
                          @"username":[[GYUser loadUserInfo] username] == nil ? @"" : [[GYUser loadUserInfo] username],
                          @"client":@"app"
                          };
    [self POST:url parameters:dic success:successCallBack error:errorCallBack];
}

+ (void)requestLocation:(NSString *)area_id success:(SuccessCallBack)successCallBack error:(ErrorCallBlck)errorCallBack {
    NSString *url = @"index.php?act=area&op=area_list";
    NSDictionary *dic = @{@"area_id":area_id};
    [self GET:url parameters:dic success:successCallBack error:errorCallBack];
}

+ (void)requestSMSCode:(NSString *)mobile_phone success:(SuccessCallBack)successCallBack error:(ErrorCallBlck)errorCallBack {
    NSString *url = @"index.php?act=login&op=send_msg";
    NSDictionary *dic = @{@"mobile_phone":mobile_phone};
    
    [self POST:url parameters:dic success:successCallBack error:errorCallBack];
}

+ (void)requestUserFeedback:(NSString *)feedback success:(SuccessCallBack)successCallBack error:(ErrorCallBlck)errorCallBack {
    NSString *url = @"index.php?act=member_feedback&op=feedback_add";
    NSDictionary *dic = @{@"key":[[GYUser loadUserInfo] key] == nil ? @"" : [[GYUser loadUserInfo] key],
                          @"feedback":feedback};
    [self POST:url parameters:dic success:successCallBack error:errorCallBack];
}

+ (void)requestUserModifyPasswordSMSCode:(NSString *)phone success:(SuccessCallBack)successCallBack error:(ErrorCallBlck)errorCallBack {
    NSString *url = @"index.php?act=find_password&op=app_send_msg";
    NSDictionary *dic = @{@"phone":phone};
    
    [self POST:url parameters:dic success:successCallBack error:errorCallBack];
}

+ (void)requestUserModifyPassword:(NSString *)phone captcha:(NSString *)captcha password:(NSString *)password success:(SuccessCallBack)successCallBack error:(ErrorCallBlck)errorCallBack {
    NSString *url = @"index.php?act=find_password&op=app_find_password";
    NSDictionary *dic = @{@"phone":phone,@"captcha":captcha,@"password":password,@"client":@"app"};
    
    [self POST:url parameters:dic success:successCallBack error:errorCallBack];
}

+ (void)requestDeletePhoneSMS:(SuccessCallBack)successCallBack error:(ErrorCallBlck)errorCallBack {
    NSString *url = @"index.php?act=member_account&op=modify_mobile_step2";
    NSDictionary *dic = @{@"key":[[GYUser loadUserInfo] key] == nil ? @"" : [[GYUser loadUserInfo] key]};
    
    [self POST:url parameters:dic success:successCallBack error:errorCallBack];
}

+ (void)requestDeletePhone:(NSString *)auth_code success:(SuccessCallBack)successCallBack error:(ErrorCallBlck)errorCallBack {
    NSString *url = @"index.php?act=member_account&op=modify_mobile_step3";
    NSDictionary *dic = @{@"key":[[GYUser loadUserInfo] key] == nil ? @"" : [[GYUser loadUserInfo] key],@"auth_code":auth_code};
    
    [self POST:url parameters:dic success:successCallBack error:errorCallBack];
}

+ (void)requestBindPhoneSMS:(NSString *)mobile success:(SuccessCallBack)successCallBack error:(ErrorCallBlck)errorCallBack {
    NSString *url = @"index.php?act=member_account&op=bind_mobile_step1";
    NSDictionary *dic = @{@"key":[[GYUser loadUserInfo] key] == nil ? @"" : [[GYUser loadUserInfo] key],@"mobile":mobile};
    
    [self POST:url parameters:dic success:successCallBack error:errorCallBack];
}

+ (void)requestBindPhone:(NSString *)auth_code success:(SuccessCallBack)successCallBack error:(ErrorCallBlck)errorCallBack {
    NSString *url = @"index.php?act=member_account&op=bind_mobile_step2";
    NSDictionary *dic = @{@"key":[[GYUser loadUserInfo] key] == nil ? @"" : [[GYUser loadUserInfo] key],@"auth_code":auth_code};
    
    [self POST:url parameters:dic success:successCallBack error:errorCallBack];
}


#pragma mark -- 获取首页数据

+ (void)requestHomeData:(SuccessCallBack)successCallBack error:(ErrorCallBlck)errorCallBack {
    NSString *url = @"index.php?act=index";
    NSDictionary *dic = @{};
    
    [self GET:url parameters:dic success:successCallBack error:errorCallBack];
}

+ (void)requestGoodsDetails:(NSString *)goods_id success:(SuccessCallBack)successCallBack error:(ErrorCallBlck)errorCallBack {
    NSString *url = @"index.php?act=goods&op=goods_detail";
    
    //判断用户是否登入
    NSDictionary *dic;
    if ([GYUser loadUserInfo] == nil) {
        dic = @{@"goods_id":goods_id};
    }else {
        dic = @{@"key":[[GYUser loadUserInfo] key] == nil ? @"" : [[GYUser loadUserInfo] key],@"goods_id":goods_id};
    }
    
    //NSLog(@"dic===========%@",dic);
    [self GET:url parameters:dic success:successCallBack error:errorCallBack];
}

+ (void)requestAddGoodsfavorites:(NSString *)goods_id success:(SuccessCallBack)successCallBack error:(ErrorCallBlck)errorCallBack {
    NSString *url = @"index.php?act=member_favorites&op=favorites_add";
    NSDictionary *dic = @{@"key":[[GYUser loadUserInfo] key] == nil ? @"" : [[GYUser loadUserInfo] key],@"goods_id":goods_id};
    
    [self POST:url parameters:dic success:successCallBack error:errorCallBack];
}

+ (void)requestCancelGoodsfavorites:(NSString *)fav_id success:(SuccessCallBack)successCallBack error:(ErrorCallBlck)errorCallBack {
    NSString *url = @"index.php?act=member_favorites&op=favorites_del";
    NSDictionary *dic = @{@"key":[[GYUser loadUserInfo] key] == nil ? @"" : [[GYUser loadUserInfo] key],@"fav_id":fav_id};
    
    [self POST:url parameters:dic success:successCallBack error:errorCallBack];
}

+ (void)requestGoodsEvaluate:(NSString *)goods_id curpage:(NSString *)curpage page:(NSString *)page type:(NSString *)type success:(SuccessCallBack)successCallBack error:(ErrorCallBlck)errorCallBack {
    NSString *url = @"index.php?act=goods&op=app_goods_evaluate";
    NSDictionary *dic = @{@"goods_id":goods_id,@"curpage":curpage,@"page":page,@"type":type};
    
    [self GET:url parameters:dic success:successCallBack error:errorCallBack];
}

+ (void)requestGoodsImageDetails:(NSString *)goods_id success:(SuccessCallBack)successCallBack error:(ErrorCallBlck)errorCallBack {
    NSString *url = @"index.php?act=goods&op=app_goods_body";
    NSDictionary *dic = @{@"goods_id":goods_id};
    
    [self GET:url parameters:dic success:successCallBack error:errorCallBack];
}

+ (void)requestHotSearch:(SuccessCallBack)successCallBack error:(ErrorCallBlck)errorCallBack {
    NSString *url = @"index.php?act=index&op=search_key_list";
    NSDictionary *dic = @{};
    
    [self GET:url parameters:dic success:successCallBack error:errorCallBack];
}

+ (void)requestModfyUserName:(NSString *)member_name success:(SuccessCallBack)successCallBack error:(ErrorCallBlck)errorCallBack {
    NSString *url = @"index.php?act=member_account&op=edit_member_name";
    NSDictionary *dic = @{@"key":[[GYUser loadUserInfo] key] == nil ? @"" : [[GYUser loadUserInfo] key],@"member_name":member_name};
    
    [self POST:url parameters:dic success:successCallBack error:errorCallBack];
}

+ (void)requestHomeSpecial:(NSString *)special_id success:(SuccessCallBack)successCallBack error:(ErrorCallBlck)errorCallBack {
    NSString *url = @"index.php?act=index&op=special";
    NSDictionary *dic = @{@"special_id":special_id};
    
    [self GET:url parameters:dic success:successCallBack error:errorCallBack];
}

+ (void)requestGoodsFreight:(NSString *)goods_id area_id:(NSString *)area_id success:(SuccessCallBack)successCallBack error:(ErrorCallBlck)errorCallBack {
    NSString *url = @"index.php?act=goods&op=calc";
    NSDictionary *dic = @{@"goods_id":goods_id,@"area_id":area_id};
    
    [self GET:url parameters:dic success:successCallBack error:errorCallBack];
}

#pragma mark -- 店铺接口

+ (void)requestStoreScoreInfo:(NSString *)store_id success:(SuccessCallBack)successCallBack error:(ErrorCallBlck)errorCallBack {
    NSString *url = @"index.php?act=store&op=store_credit";
    NSDictionary *dic = @{@"store_id":store_id};
    
    [self GET:url parameters:dic success:successCallBack error:errorCallBack];
}

+ (void)requestStoreInfo:(NSString *)store_id success:(SuccessCallBack)successCallBack error:(ErrorCallBlck)errorCallBack {
    NSString *url = @"index.php?act=store&op=store_info";
    NSDictionary *dic;
    if ([GYUser loadUserInfo] == nil) {
        dic = @{@"store_id":store_id};
    }else {
        dic = @{@"key":[[GYUser loadUserInfo] key] == nil ? @"" : [[GYUser loadUserInfo] key],@"store_id":store_id};
    }
    
    [self POST:url parameters:dic success:successCallBack error:errorCallBack];
}

+ (void)requestStoreFavorites:(NSString *)store_id success:(SuccessCallBack)successCallBack error:(ErrorCallBlck)errorCallBack {
    NSString *url = @"index.php?act=member_favorites_store&op=favorites_add";
    NSDictionary *dic;
    if ([GYUser loadUserInfo] == nil) {
        dic = @{@"store_id":store_id};
    }else {
        dic = @{@"key":[[GYUser loadUserInfo] key] == nil ? @"" : [[GYUser loadUserInfo] key],@"store_id":store_id};
    }
    
    [self POST:url parameters:dic success:successCallBack error:errorCallBack];
}

+ (void)requestCancelStoreFavorites:(NSString *)store_id success:(SuccessCallBack)successCallBack error:(ErrorCallBlck)errorCallBack {
    NSString *url = @"index.php?act=member_favorites_store&op=favorites_del";
    NSDictionary *dic;
    if ([GYUser loadUserInfo] == nil) {
        dic = @{@"store_id":store_id};
    }else {
        dic = @{@"key":[[GYUser loadUserInfo] key] == nil ? @"" : [[GYUser loadUserInfo] key],@"store_id":store_id};
    }
    
    [self POST:url parameters:dic success:successCallBack error:errorCallBack];
}

+ (void)requestStoreGoodsRank:(NSString *)store_id ordertype:(NSString *)ordertype success:(SuccessCallBack)successCallBack error:(ErrorCallBlck)errorCallBack {
    NSString *url = @"index.php?act=store&op=store_goods_rank";
    NSDictionary *dic = @{@"store_id":store_id,@"ordertype":ordertype};
    
    [self POST:url parameters:dic success:successCallBack error:errorCallBack];
}

+ (void)requestStoreAllGoods:(NSString *)store_id curpage:(NSString *)curpage page:(NSString *)page stc_id:(NSString *)stc_id keyword:(NSString *)keyword key:(NSString *)key order:(NSString *)order price_from:(NSString *)price_from price_to:(NSString *)price_to success:(SuccessCallBack)successCallBack error:(ErrorCallBlck)errorCallBack {
    NSString *url = @"index.php?act=store&op=store_goods";
    NSDictionary *dic = @{@"store_id":store_id,@"curpage":@"curpage",@"page":page,@"stc_id":stc_id,@"keyword":keyword,@"key":key,@"order":order,@"price_from":price_from,@"price_to":price_to};
    
    [self GET:url parameters:dic success:successCallBack error:errorCallBack];
}

+ (void)requestStoreNewGoods:(NSString *)store_id curpage:(NSString *)curpage page:(NSString *)page success:(SuccessCallBack)successCallBack error:(ErrorCallBlck)errorCallBack {
    NSString *url = @"index.php?act=store&op=store_new_goods";
    NSDictionary *dic = @{@"store_id":store_id,@"curpage":@"curpage",@"page":page};
    
    [self GET:url parameters:dic success:successCallBack error:errorCallBack];
}

+ (void)requestStoreIntroduce:(NSString *)store_id success:(SuccessCallBack)successCallBack error:(ErrorCallBlck)errorCallBack {
    NSString *url = @"index.php?act=store&op=store_intro";
    NSDictionary *dic;
    if ([GYUser loadUserInfo] == nil) {
        dic = @{@"store_id":store_id};
    }else {
        dic = @{@"key":[[GYUser loadUserInfo] key] == nil ? @"" : [[GYUser loadUserInfo] key],@"store_id":store_id};
    }
    
    [self POST:url parameters:dic success:successCallBack error:errorCallBack];
}

+ (void)requestSpecial:(SuccessCallBack)successCallBack error:(ErrorCallBlck)errorCallBack {
    NSString *url = @"index.php?act=index&op=special";
    NSDictionary *dic = @{};
    
    [self GET:url parameters:dic success:successCallBack error:errorCallBack];
}

#pragma mark -- 分类

+ (void)requestLargeCategory:(SuccessCallBack)successCallBack error:(ErrorCallBlck)errorCallBack {
    NSString *url = @"index.php?act=goods_class";
    NSDictionary *dic = @{};
    
    [self GET:url parameters:dic success:successCallBack error:errorCallBack];
}

+ (void)requestSubclassCategory:(NSString *)gc_id success:(SuccessCallBack)successCallBack error:(ErrorCallBlck)errorCallBack {
    NSString *url = @"index.php?act=goods_class&op=get_child_all";
    NSDictionary *dic = @{@"gc_id":gc_id};
    
    [self GET:url parameters:dic success:successCallBack error:errorCallBack];
}

+ (void)requestGoodList:(NSString *)gc_id keyword:(NSString *)keyword page:(NSString *)page curpage:(NSString *)curpage key:(NSString *)key order:(NSString *)order success:(SuccessCallBack)successCallBack error:(ErrorCallBlck)errorCallBack {
    NSString *url = @"index.php?act=goods&op=goods_list";
    if (gc_id == nil) {
        gc_id = @"";
    }
    if (keyword == nil) {
        keyword = @"";
    }
    NSDictionary *dic = @{@"gc_id":gc_id,@"keyword":keyword,@"page":page,@"curpage":curpage,@"key":key == nil ? @"" : key,@"order":order};
    
    [self GET:url parameters:dic success:successCallBack error:errorCallBack];
}


#pragma mark -- 我的

+ (void)requestUserInfo:(NSString *)key success:(SuccessCallBack)successCallBack error:(ErrorCallBlck)errorCallBack {
    NSString *url = @"index.php?act=member_index";
    NSDictionary *dic = @{@"key":key == nil ? @"" : key};
    
    [self POST:url parameters:dic success:successCallBack error:errorCallBack];
}


+ (void)requestUserCommodityCollection:(NSString *)curpage page:(NSString *)page success:(SuccessCallBack)successCallBack error:(ErrorCallBlck)errorCallBack {
    NSString *url = @"index.php?act=member_favorites&op=favorites_list";
    NSDictionary *dic = @{@"key":[[GYUser loadUserInfo] key] == nil ? @"" : [[GYUser loadUserInfo] key],
                          @"curpage":curpage,
                          @"page":page
                          };
    [self GET:url parameters:dic success:successCallBack error:errorCallBack];
}

+ (void)requestUserShopCollection:(NSString *)curpage page:(NSString *)page success:(SuccessCallBack)successCallBack error:(ErrorCallBlck)errorCallBack {
    NSString *url = @"index.php?act=member_favorites_store&op=favorites_list";
    NSDictionary *dic = @{@"key":[[GYUser loadUserInfo] key] == nil ? @"" : [[GYUser loadUserInfo] key],
                          @"curpage":curpage,
                          @"page":page
                          };
    
    [self GET:url parameters:dic success:successCallBack error:errorCallBack];
}

+ (void)requestUserFootprint:(NSString *)curpage page:(NSString *)page success:(SuccessCallBack)successCallBack error:(ErrorCallBlck)errorCallBack {
    NSString *url = @"index.php?act=member_goodsbrowse&op=browse_list";
    NSDictionary *dic = @{@"key":[[GYUser loadUserInfo] key] == nil ? @"" : [[GYUser loadUserInfo] key],
                          @"curpage":curpage,
                          @"page":page
                          };
    [self GET:url parameters:dic success:successCallBack error:errorCallBack];
}

+ (void)requestRemoveAllUserFootprint:(SuccessCallBack)successCallBack error:(ErrorCallBlck)errorCallBack {
    NSString *url = @"index.php?act=member_goodsbrowse&op=browse_clearall";
    NSDictionary *dic = @{@"key":[[GYUser loadUserInfo] key] == nil ? @"" : [[GYUser loadUserInfo] key]};
    
    [self GET:url parameters:dic success:successCallBack error:errorCallBack];
}


+ (void)requestApplyVIP:(NSString *)vip_name vip_phone:(NSString *)vip_phone vip_address:(NSString *)vip_address vip_inviter_code:(NSString *)vip_inviter_code success:(SuccessCallBack)successCallBack error:(ErrorCallBlck)errorCallBack {
    NSString *url = @"index.php?act=vip_apply&op=apply_vip";
    NSDictionary *dic = @{@"key":[[GYUser loadUserInfo] key] == nil ? @"" : [[GYUser loadUserInfo] key],@"vip_name":vip_name,@"vip_phone":vip_phone,@"vip_address":vip_address,@"vip_inviter_code":vip_inviter_code};
    
    [self POST:url parameters:dic success:successCallBack error:errorCallBack];
}

+ (void)requestUserAddress:(SuccessCallBack)successCallBack error:(ErrorCallBlck)errorCallBack {
    NSString *url = @"index.php?act=member_address&op=address_list";
    NSDictionary *dic = @{@"key":[[GYUser loadUserInfo] key] == nil ? @"" : [[GYUser loadUserInfo] key]};
    
    [self POST:url parameters:dic success:successCallBack error:errorCallBack];
}

+ (void)requestAddUserAddress:(NSString *)true_name mob_phone:(NSString *)mob_phone city_id:(NSString *)city_id area_id:(NSString *)area_id address:(NSString *)address area_info:(NSString *)area_info is_default:(NSString *)is_default success:(SuccessCallBack)successCallBack error:(ErrorCallBlck)errorCallBack {
    NSString *url = @"index.php?act=member_address&op=address_add";
    NSDictionary *dic = @{@"key":[[GYUser loadUserInfo] key] == nil ? @"" : [[GYUser loadUserInfo] key],
                          @"true_name":true_name,
                          @"mob_phone":mob_phone,
                          @"city_id":city_id,
                          @"area_id":area_id,
                          @"address":address,
                          @"area_info":area_info,
                          @"is_default":is_default
                          };
    //NSLog(@"dic===========%@",dic);
    [self POST:url parameters:dic success:successCallBack error:errorCallBack];
}

+ (void)requestDeleteUserAddress:(NSString *)address_id success:(SuccessCallBack)successCallBack error:(ErrorCallBlck)errorCallBack {
    NSString *url = @"index.php?act=member_address&op=address_del";
    NSDictionary *dic = @{@"key":[[GYUser loadUserInfo] key] == nil ? @"" : [[GYUser loadUserInfo] key],
                          @"address_id":address_id};
    
    [self POST:url parameters:dic success:successCallBack error:errorCallBack];
}

+ (void)requestUpdateUserAddress:(NSString *)address_id true_name:(NSString *)true_name mob_phone:(NSString *)mob_phone city_id:(NSString *)city_id area_id:(NSString *)area_id address:(NSString *)address area_info:(NSString *)area_info is_default:(NSString *)is_default success:(SuccessCallBack)successCallBack error:(ErrorCallBlck)errorCallBack {
    NSString *url = @"index.php?act=member_address&op=address_edit";
    NSDictionary *dic = @{@"key":[[GYUser loadUserInfo] key] == nil ? @"" : [[GYUser loadUserInfo] key],
                          @"address_id":address_id,
                          @"true_name":true_name,
                          @"mob_phone":mob_phone,
                          @"city_id":city_id,
                          @"area_id":area_id,
                          @"address":address,
                          @"area_info":area_info,
                          @"is_default":is_default
                          };
    [self POST:url parameters:dic success:successCallBack error:errorCallBack];
}

+ (void)requestUserProperty:(SuccessCallBack)successCallBack error:(ErrorCallBlck)errorCallBack {
    NSString *url = @"index.php?act=member_index&op=my_asset";
    NSDictionary *dic = @{@"key":[[GYUser loadUserInfo] key] == nil ? @"" : [[GYUser loadUserInfo] key]};
    
    [self GET:url parameters:dic success:successCallBack error:errorCallBack];
}

+ (void)requestPointsDetails:(NSString *)curpage page:(NSString *)page success:(SuccessCallBack)successCallBack error:(ErrorCallBlck)errorCallBack {
    NSString *url = @"index.php?act=member_points&op=pointslog";
    NSDictionary *dic = @{@"key":[[GYUser loadUserInfo] key] == nil ? @"" : [[GYUser loadUserInfo] key],@"curpage":curpage,@"page":page};
    [self GET:url parameters:dic success:successCallBack error:errorCallBack];
}

+ (void)requestSystemMessage:(SuccessCallBack)successCallBack error:(ErrorCallBlck)errorCallBack {
    NSString *url = @"index.php?act=member_message&op=systemmsg";
    NSDictionary *dic = @{@"key":[[GYUser loadUserInfo] key] == nil ? @"" : [[GYUser loadUserInfo] key]};
    
    [self POST:url parameters:dic success:successCallBack error:errorCallBack];
}

+ (void)requestModfyUserHeadImage:(NSData *)imageData success:(SuccessCallBack)successCallBack error:(ErrorCallBlck)errorCallBack {
    NSString *url = @"index.php?act=member_account&op=edit_member_avatar";
    NSDictionary *dic = @{};
    
    [[self Manager] POST:url parameters:dic constructingBodyWithBlock:^(id<AFMultipartFormData>  _Nonnull formData) {
        [formData appendPartWithFormData:[[[GYUser loadUserInfo] key] == nil ? @"" : [[GYUser loadUserInfo] key] dataUsingEncoding:NSUTF8StringEncoding] name:@"key"];
        [formData appendPartWithFileData:imageData name:@"avatar_pic" fileName:@"image.jpg" mimeType:@"image/jpg"];
        
    } progress:^(NSProgress * _Nonnull uploadProgress) {
        
    } success:^(NSURLSessionDataTask * _Nonnull task, id  _Nullable responseObject) {
        NSDictionary *dic = [NSJSONSerialization JSONObjectWithData:responseObject options:0 error:nil];
        
        successCallBack(dic);
    } failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {
        
        NSLog(@"上传失败 ===> %@", error);
        errorCallBack(error);
    }];
}

+ (void)requestPayPwdGetVerCode:(SuccessCallBack)successCallBack error:(ErrorCallBlck)errorCallBack {
    NSString *url = @"index.php?act=member_account&op=modify_paypwd_step2";
    NSDictionary *dic = @{@"key":[[GYUser loadUserInfo] key] == nil ? @"" : [[GYUser loadUserInfo] key]};
    
    [self POST:url parameters:dic success:successCallBack error:errorCallBack];
}

+ (void)requestVerPayPwdVerCode:(NSString *)auth_code success:(SuccessCallBack)successCallBack error:(ErrorCallBlck)errorCallBack {
    NSString *url = @"index.php?act=member_account&op=modify_paypwd_step3";
    NSDictionary *dic = @{@"key":[[GYUser loadUserInfo] key] == nil ? @"" : [[GYUser loadUserInfo] key],@"auth_code":auth_code};
    
    [self POST:url parameters:dic success:successCallBack error:errorCallBack];
}

+ (void)requestPayPwd:(NSString *)password password1:(NSString *)password1 success:(SuccessCallBack)successCallBack error:(ErrorCallBlck)errorCallBack {
    NSString *url = @"index.php?act=member_account&op=modify_paypwd_step5";
    NSDictionary *dic = @{@"key":[[GYUser loadUserInfo] key] == nil ? @"" : [[GYUser loadUserInfo] key],@"password":password,@"password1":password1};
    
    [self POST:url parameters:dic success:successCallBack error:errorCallBack];
}

#pragma mark -- 订单

+ (void)requestConfirmOrderInfo:(NSString *)ifcart cart_id:(NSString *)cart_id address_id:(NSString *)address_id success:(SuccessCallBack)successCallBack error:(ErrorCallBlck)errorCallBack {
    NSString *url = @"index.php?act=member_buy&op=app_buy_step1";
    NSDictionary *dic = @{@"key":[[GYUser loadUserInfo] key] == nil ? @"" : [[GYUser loadUserInfo] key],@"ifcart":ifcart,@"cart_id":cart_id,@"address_id":address_id};
    
    [self POST:url parameters:dic success:successCallBack error:errorCallBack];
}


+ (void)requestOrderList:(NSString *)state_type order_key:(NSString *)order_key page:(NSString *)page curpage:(NSString *)curpage success:(SuccessCallBack)successCallBack error:(ErrorCallBlck)errorCallBack {
    NSString *url = @"index.php?act=member_order&op=order_list";
    NSDictionary *dic = @{@"key":[[GYUser loadUserInfo] key] == nil ? @"" : [[GYUser loadUserInfo] key],@"state_type":state_type,@"order_key":order_key,@"page":page,@"curpage":curpage};
    
    [self POST:url parameters:dic success:successCallBack error:errorCallBack];
}

+ (void)requestDeleteOrder:(NSString *)order_id success:(SuccessCallBack)successCallBack error:(ErrorCallBlck)errorCallBack {
    NSString *url = @"index.php?act=member_order&op=order_delete";
    NSDictionary *dic = @{@"key":[[GYUser loadUserInfo] key] == nil ? @"" : [[GYUser loadUserInfo] key],@"order_id":order_id};
    
    [self POST:url parameters:dic success:successCallBack error:errorCallBack];
}

+ (void)requestCancelOrder:(NSString *)order_id success:(SuccessCallBack)successCallBack error:(ErrorCallBlck)errorCallBack {
    NSString *url = @"index.php?act=member_order&op=order_cancel";
    NSDictionary *dic = @{@"key":[[GYUser loadUserInfo] key] == nil ? @"" : [[GYUser loadUserInfo] key],@"order_id":order_id};
    [self POST:url parameters:dic success:successCallBack error:errorCallBack];
}

+ (void)requestConfirmationReceipt:(NSString *)order_id success:(SuccessCallBack)successCallBack error:(ErrorCallBlck)errorCallBack {
    NSString *url = @"index.php?act=member_order&op=order_receive";
    NSDictionary *dic = @{@"key":[[GYUser loadUserInfo] key] == nil ? @"" : [[GYUser loadUserInfo] key],@"order_id":order_id};
    [self POST:url parameters:dic success:successCallBack error:errorCallBack];
}

+ (void)requestOrderDetails:(NSString *)order_id success:(SuccessCallBack)successCallBack error:(ErrorCallBlck)errorCallBack {
    NSString *url = @"index.php?act=member_order&op=order_info";
    NSDictionary *dic = @{@"key":[[GYUser loadUserInfo] key] == nil ? @"" : [[GYUser loadUserInfo] key],@"order_id":order_id};
    [self GET:url parameters:dic success:successCallBack error:errorCallBack];
}

+(void)requestOrderALLRefundDetailInfo:(NSString *)order_id success:(SuccessCallBack)successCallBack error:(ErrorCallBlck)errorCallBack {
    NSString *url = @"index.php?act=member_refund&op=refund_all_form";
    NSDictionary *dic = @{@"key":[[GYUser loadUserInfo] key] == nil ? @"" : [[GYUser loadUserInfo] key],@"order_id":order_id};
    [self GET:url parameters:dic success:successCallBack error:errorCallBack];
    //[self POST:url parameters:dic success:successCallBack error:errorCallBack];
}

+ (void)requestOrderRefundOrderDetailsInfo:(NSString *)order_id order_goods_id:(NSString *)order_goods_id success:(SuccessCallBack)successCallBack error:(ErrorCallBlck)errorCallBack{
    NSString *url = @"index.php?act=member_refund&op=refund_form";
    NSDictionary *dic = @{@"key":[[GYUser loadUserInfo] key] == nil ? @"" : [[GYUser loadUserInfo] key],@"order_id":order_id,@"order_goods_id":order_goods_id};
    NSLog(@"dic=======%@",dic);
    [self GET:url parameters:dic success:successCallBack error:errorCallBack];
    //[self POST:url parameters:dic success:successCallBack error:errorCallBack];
}

+ (void)requestUploadRefundImageData:(NSData *)imageData success:(SuccessCallBack)successCallBack error:(ErrorCallBlck)errorCallBack {
    NSString *url = @"index.php?act=member_refund&op=upload_pic";
    NSDictionary *dic = @{};

    [[self Manager] POST:url parameters:dic constructingBodyWithBlock:^(id<AFMultipartFormData>  _Nonnull formData) {
        [formData appendPartWithFormData:[[[GYUser loadUserInfo] key] == nil ? @"" : [[GYUser loadUserInfo] key] dataUsingEncoding:NSUTF8StringEncoding] name:@"key"];
        [formData appendPartWithFileData:imageData name:@"refund_pic" fileName:@"image.jpg" mimeType:@"image/jpg"];
        
    } progress:^(NSProgress * _Nonnull uploadProgress) {
        
    } success:^(NSURLSessionDataTask * _Nonnull task, id  _Nullable responseObject) {
        NSDictionary *dic = [NSJSONSerialization JSONObjectWithData:responseObject options:0 error:nil];
        
        successCallBack(dic);
    } failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {
        
        NSLog(@"上传失败 ===> %@", error);
        errorCallBack(error);
    }];
}

+ (void)requestRefundAllMoney:(NSString *)order_id buyer_message:(NSString *)buyer_message refund_pic:(NSArray *)refund_pic success:(SuccessCallBack)successCallBack error:(ErrorCallBlck)errorCallBack {
    NSString *url = @"index.php?act=member_refund&op=refund_all_post";
    NSDictionary *dic = @{@"key":[[GYUser loadUserInfo] key] == nil ? @"" : [[GYUser loadUserInfo] key],
                          @"order_id":order_id,
                          @"buyer_message":buyer_message,
                          @"refund_pic":refund_pic
                          };
    [self POST:url parameters:dic success:successCallBack error:errorCallBack];
}

+ (void)requestDeliverGoodsOrderRefund:(NSString *)order_id order_goods_id:(NSString *)order_goods_id refund_type:(NSString *)refund_type reason_id:(NSString *)reason_id refund_amount:(NSString *)refund_amount goods_num:(NSString *)goods_num buyer_message:(NSString *)buyer_message refund_pic:(NSArray *)refund_pic success:(SuccessCallBack)successCallBack error:(ErrorCallBlck)errorCallBack {
    NSString *url = @"index.php?act=member_refund&op=refund_post";
    NSDictionary *dic = @{@"key":[[GYUser loadUserInfo] key] == nil ? @"" : [[GYUser loadUserInfo] key],
                          @"order_id":order_id,
                          @"order_goods_id":order_goods_id,
                          @"refund_type":refund_type,
                          @"reason_id":reason_id,
                          @"refund_amount":refund_amount,
                          @"goods_num":goods_num,
                          @"buyer_message":buyer_message,
                          @"refund_pic":refund_pic
                          };
    
    [self POST:url parameters:dic success:successCallBack error:errorCallBack];
}

+ (void)requestRefundList:(NSString *)curpage page:(NSString *)page success:(SuccessCallBack)successCallBack error:(ErrorCallBlck)errorCallBack {
    NSString *url = @"index.php?act=member_refund&op=get_refund_list";
    NSDictionary *dic = @{@"key":[[GYUser loadUserInfo] key] == nil ? @"" : [[GYUser loadUserInfo] key],@"curpage":curpage,@"page":page};
    [self GET:url parameters:dic success:successCallBack error:errorCallBack];
}

+ (void)requestReturnGoodsList:(NSString *)curpage page:(NSString *)page success:(SuccessCallBack)successCallBack error:(ErrorCallBlck)errorCallBack {
    NSString *url = @"index.php?act=member_return&op=get_return_list";
    NSDictionary *dic = @{@"key":[[GYUser loadUserInfo] key] == nil ? @"" : [[GYUser loadUserInfo] key],@"curpage":curpage,@"page":page};
    [self GET:url parameters:dic success:successCallBack error:errorCallBack];
}

+ (void)requestOrderEvaluateDetailsInfo:(NSString *)order_id success:(SuccessCallBack)successCallBack error:(ErrorCallBlck)errorCallBack {
    NSString *url = @"index.php?act=member_evaluate&op=index";
    NSDictionary *dic = @{@"key":[[GYUser loadUserInfo] key] == nil ? @"" : [[GYUser loadUserInfo] key],@"order_id":order_id};
    [self GET:url parameters:dic success:successCallBack error:errorCallBack];
}

+ (void)requestOrderEvaluateUploadImage:(NSString *)category_id imageData:(NSData *)data success:(SuccessCallBack)successCallBack error:(ErrorCallBlck)errorCallBack {
    NSString *url = @"index.php?act=sns_album&op=file_upload";
    NSDictionary *dic = @{@"key":[[GYUser loadUserInfo] key] == nil ? @"" : [[GYUser loadUserInfo] key],@"category_id":category_id};
    
    [[self Manager] POST:url parameters:dic constructingBodyWithBlock:^(id<AFMultipartFormData>  _Nonnull formData) {
        [formData appendPartWithFormData:[[[GYUser loadUserInfo] key] == nil ? @"" : [[GYUser loadUserInfo] key] dataUsingEncoding:NSUTF8StringEncoding] name:@"key"];
        [formData appendPartWithFormData:[category_id dataUsingEncoding:NSUTF8StringEncoding] name:@"category_id"];
        [formData appendPartWithFileData:data name:@"file" fileName:@"image.jpg" mimeType:@"image/jpg"];
        
    } progress:^(NSProgress * _Nonnull uploadProgress) {
        
    } success:^(NSURLSessionDataTask * _Nonnull task, id  _Nullable responseObject) {
        NSDictionary *dic = [NSJSONSerialization JSONObjectWithData:responseObject options:0 error:nil];
        
        successCallBack(dic);
    } failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {
        
        NSLog(@"上传失败 ===> %@", error);
        errorCallBack(error);
    }];
}

+ (void)requestSubmitOrderEvaluate:(NSMutableDictionary *)paramDic order_id:(NSString *)order_id store_desccredit:(NSString *)store_desccredit store_servicecredit:(NSString *)store_servicecredit store_deliverycredit:(NSString *)store_deliverycredit success:(SuccessCallBack)successCallBack error:(ErrorCallBlck)errorCallBack {
    NSString *url = @"index.php?act=member_evaluate&op=save";
    
    [paramDic setObject:[[GYUser loadUserInfo] key] == nil ? @"" : [[GYUser loadUserInfo] key] forKey:@"key"];
    [paramDic setObject:order_id forKey:@"order_id"];
    [paramDic setObject:store_desccredit forKey:@"store_desccredit"];
    [paramDic setObject:store_deliverycredit forKey:@"store_deliverycredit"];
    [paramDic setObject:store_deliverycredit forKey:@"store_deliverycredit"];
    //NSLog(@"dic========%@",paramDic);
    [self POST:url parameters:paramDic success:successCallBack error:errorCallBack];
}

+ (void)requestShopingCartList:(SuccessCallBack)successCallBack error:(ErrorCallBlck)errorCallBack {
    NSString *url = @"index.php?act=member_cart&op=cart_list";
    NSDictionary *dic = @{@"key":[[GYUser loadUserInfo] key] == nil ? @"" : [[GYUser loadUserInfo] key]};
    [self POST:url parameters:dic success:successCallBack error:errorCallBack];
}

+ (void)requestInvoiceList:(SuccessCallBack)successCallBack error:(ErrorCallBlck)errorCallBack {
    NSString *url = @"index.php?act=member_invoice&op=invoice_list";
    NSDictionary *dic = @{@"key":[[GYUser loadUserInfo] key] == nil ? @"" : [[GYUser loadUserInfo] key]};
    [self POST:url parameters:dic success:successCallBack error:errorCallBack];
}

+ (void)requestAddInvoice:(NSString *)inv_title_select inv_title:(NSString *)inv_title inv_content:(NSString *)inv_content inv_code:(NSString *)inv_code success:(SuccessCallBack)successCallBack error:(ErrorCallBlck)errorCallBack {
    NSString *url = @"index.php?act=member_invoice&op=invoice_add";
    NSDictionary *dic = @{@"key":[[GYUser loadUserInfo] key] == nil ? @"" : [[GYUser loadUserInfo] key],@"inv_title_select":inv_title_select,@"inv_title":inv_title,@"inv_content":inv_content,@"inv_code":inv_code};
    [self POST:url parameters:dic success:successCallBack error:errorCallBack];
}

+ (void)requestDeleteInvoicr:(NSString *)inv_id success:(SuccessCallBack)successCallBack error:(ErrorCallBlck)errorCallBack {
    NSString *url = @"index.php?act=member_invoice&op=invoice_del";
    NSDictionary *dic = @{@"key":[[GYUser loadUserInfo] key] == nil ? @"" : [[GYUser loadUserInfo] key],@"inv_id":inv_id};
    [self POST:url parameters:dic success:successCallBack error:errorCallBack];
}

+ (void)requestSubOrder:(NSString *)ifcart cart_id:(NSString *)cart_id address_id:(NSString *)address_id vat_hash:(NSString *)vat_hash offpay_hash:(NSString *)offpay_hash offpay_hash_batch:(NSString *)offpay_hash_batch pay_name:(NSString *)pay_name invoice_id:(NSString *)invoice_id pd_pay:(NSString *)pd_pay password:(NSString *)password fcode:(NSString *)fcode rcb_pay:(NSString *)rcb_pay rpt:(NSString *)rpt points_orderprice:(NSString *)points_orderprice pay_message:(NSString *)pay_message is_needspay:(BOOL)is_needspay success:(SuccessCallBack)successCallBack error:(ErrorCallBlck)errorCallBack {
    NSString *url = @"index.php?act=member_buy&op=buy_step2";
    NSDictionary *dic = @{@"key":[[GYUser loadUserInfo] key] == nil ? @"" : [[GYUser loadUserInfo] key],
                          @"ifcart":ifcart,
                          @"cart_id":cart_id,
                          @"address_id":address_id,
                          @"vat_hash":vat_hash,
                          @"offpay_hash":offpay_hash,
                          @"offpay_hash_batch":offpay_hash_batch,
                          @"pay_name":pay_name,
                          @"invoice_id":invoice_id,
                          @"pd_pay":pd_pay,
                          @"password":password,
                          @"fcode":fcode,
                          @"rcb_pay":rcb_pay,
                          @"rpt":rpt,
                          @"points_orderprice":points_orderprice,
                          @"pay_message":pay_message,
                          @"is_needspay":@(is_needspay)
                          };
    [self POST:url parameters:dic success:successCallBack error:errorCallBack];
}

+ (void)requestShopingCartAddGoods:(NSString *)goods_id quantity:(NSString *)quantity success:(SuccessCallBack)successCallBack error:(ErrorCallBlck)errorCallBack {
    NSString *url = @"index.php?act=member_cart&op=cart_add";
    NSDictionary *dic = @{@"key":[[GYUser loadUserInfo] key] == nil ? @"" : [[GYUser loadUserInfo] key],@"goods_id":goods_id,@"quantity":quantity};
    [self POST:url parameters:dic success:successCallBack error:errorCallBack];
}

+ (void)requestQueryShopingCartGoodsNum:(SuccessCallBack)successCallBack error:(ErrorCallBlck)errorCallBack {
    NSString *url = @"index.php?act=member_cart&op=cart_count";
    NSDictionary *dic = @{@"key":[[GYUser loadUserInfo] key] == nil ? @"" : [[GYUser loadUserInfo] key]};
    [self POST:url parameters:dic success:successCallBack error:errorCallBack];
}

+ (void)requestUpdateShopingCartGoodsNum:(NSString *)cart_id quantity:(NSString *)quantity success:(SuccessCallBack)successCallBack error:(ErrorCallBlck)errorCallBack {
    NSString *url = @"index.php?act=member_cart&op=cart_edit_quantity";
    NSDictionary *dic = @{@"key":[[GYUser loadUserInfo] key] == nil ? @"" : [[GYUser loadUserInfo] key],@"cart_id":cart_id,@"quantity":quantity};
    
    [self POST:url parameters:dic success:successCallBack error:errorCallBack];
}

+ (void)requestDeleteShopingCartGoods:(NSString *)cart_id success:(SuccessCallBack)successCallBack error:(ErrorCallBlck)errorCallBack {
    NSString *url = @"index.php?act=member_cart&op=cart_del";
    NSDictionary *dic = @{@"key":[[GYUser loadUserInfo] key] == nil ? @"" : [[GYUser loadUserInfo] key],@"cart_id":cart_id};
    [self POST:url parameters:dic success:successCallBack error:errorCallBack];
}

+ (void)requestInvoiceContentList:(SuccessCallBack)successCallBack error:(ErrorCallBlck)errorCallBack {
    NSString *url = @"index.php?act=member_invoice&op=invoice_content_list";
    NSDictionary *dic = @{@"key":[[GYUser loadUserInfo] key] == nil ? @"" : [[GYUser loadUserInfo] key]};
    [self POST:url parameters:dic success:successCallBack error:errorCallBack];
}

+ (void)requestVerPayPwd:(SuccessCallBack)successCallBack error:(ErrorCallBlck)errorCallBack {
    NSString *url = @"index.php?act=member_buy&op=check_setpaypwd";
    NSDictionary *dic = @{@"key":[[GYUser loadUserInfo] key] == nil ? @"" : [[GYUser loadUserInfo] key]};
    [self GET:url parameters:dic success:successCallBack error:errorCallBack];
}

+ (void)requestcheckPassword:(NSString *)password success:(SuccessCallBack)successCallBack error:(ErrorCallBlck)errorCallBack {
    NSString *url = @"index.php?act=member_buy&op=check_password";
    NSDictionary *dic = @{@"key":[[GYUser loadUserInfo] key] == nil ? @"" : [[GYUser loadUserInfo] key],@"password":password};
    [self POST:url parameters:dic success:successCallBack error:errorCallBack];
}

+ (void)reqeuestPayNeedspay:(NSString *)pay_sn success:(SuccessCallBack)successCallBack error:(ErrorCallBlck)errorCallBack {
    NSString *url = @"index.php?act=member_buy&op=pay_needspay";
    NSDictionary *dic = @{@"key":[[GYUser loadUserInfo] key] == nil ? @"" : [[GYUser loadUserInfo] key],@"pay_sn":pay_sn};
    [self POST:url parameters:dic success:successCallBack error:errorCallBack];
}

+ (void)requestDeleteRefundOrder:(NSString *)refund_id success:(SuccessCallBack)successCallBack error:(ErrorCallBlck)errorCallBack {
    NSString *url = @"index.php?act=member_refund&op=refund_delete";
    NSDictionary *dic = @{@"key":[[GYUser loadUserInfo] key] == nil ? @"" : [[GYUser loadUserInfo] key],@"refund_id":refund_id};
    [self POST:url parameters:dic success:successCallBack error:errorCallBack];
}

#pragma mark -- 支付接口

+ (void)requestPayMethodInfo:(NSString *)pay_sn success:(SuccessCallBack)successCallBack error:(ErrorCallBlck)errorCallBack {
    NSString *url = @"index.php?act=member_buy&op=pay";
    NSDictionary *dic = @{@"key":[[GYUser loadUserInfo] key] == nil ? @"" : [[GYUser loadUserInfo] key],@"pay_sn":pay_sn};
    [self POST:url parameters:dic success:successCallBack error:errorCallBack];
}

+ (void)requestLaunchPay:(NSString *)pay_sn payment_code:(NSString *)payment_code success:(SuccessCallBack)successCallBack error:(ErrorCallBlck)errorCallBack{
    NSString *url = @"index.php?act=member_payment&op=wxapp_pay";
    NSDictionary *dic = @{@"key":[[GYUser loadUserInfo] key] == nil ? @"" : [[GYUser loadUserInfo] key],@"pay_sn":pay_sn,@"payment_code":payment_code};
    [self POST:url parameters:dic success:successCallBack error:errorCallBack];
}

+ (void)requestZhifubaoPaySuccess:(NSString *)out_trade_no trade_no:(NSString *)trade_no uccess:(SuccessCallBack)successCallBack error:(ErrorCallBlck)errorCallBack {
    NSString *url = @"index.php?act=member_payment&op=ali_pay_success";
    NSDictionary *dic = @{@"key":[[GYUser loadUserInfo] key] == nil ? @"" : [[GYUser loadUserInfo] key],@"out_trade_no":out_trade_no,@"trade_no":trade_no};
    [self POST:url parameters:dic success:successCallBack error:errorCallBack];
}

+ (void)requestWeiXinPay:(NSString *)pay_sn payment_code:(NSString *)payment_code wxpay_appid:(NSString *)wxpay_appid wxpay_mch_id:(NSString *)wxpay_mch_id wxpay_key:(NSString *)wxpay_key notifyUrl:(NSString *)notifyUrl success:(SuccessCallBack)successCallBack error:(ErrorCallBlck)errorCallBack {
    NSString *url = @"index.php?act=member_payment&op=wxapp_pay";
    NSDictionary *dic = @{@"key":[[GYUser loadUserInfo] key] == nil ? @"" : [[GYUser loadUserInfo] key],@"pay_sn":pay_sn,@"payment_code":payment_code,@"wxpay_appid":wxpay_appid,@"wxpay_mch_id":wxpay_mch_id,@"wxpay_key":wxpay_key,@"notifyUrl":notifyUrl};
    [self POST:url parameters:dic success:successCallBack error:errorCallBack];
}


+ (void)requestWeiXinPaySuccess:(NSString *)out_trade_no payment_code:(NSString *)payment_code wxpay_appid:(NSString *)wxpay_appid wxpay_mch_id:(NSString *)wxpay_mch_id wxpay_key:(NSString *)wxpay_key notifyUrl:(NSString *)notifyUrl success:(SuccessCallBack)successCallBack error:(ErrorCallBlck)errorCallBack {
    NSString *url = @"index.php?act=member_payment&op=app_pay_success";
    NSDictionary *dic = @{@"key":[[GYUser loadUserInfo] key] == nil ? @"" : [[GYUser loadUserInfo] key],@"out_trade_no":out_trade_no,@"payment_code":payment_code,@"wxpay_appid":wxpay_appid,@"wxpay_mch_id":wxpay_mch_id,@"wxpay_key":wxpay_key,@"notifyUrl":notifyUrl};
    NSLog(@"dic =================%@",dic);
    [self POST:url parameters:dic success:successCallBack error:errorCallBack];
}

#pragma mark --  引导页

+ (void)requestWelcomeInfo:(SuccessCallBack)successCallBack error:(ErrorCallBlck)errorCallBack {
    NSString *url = @"index.php?act=appcovers";
    NSDictionary *dic = @{};
    [self GET:url parameters:dic success:successCallBack error:errorCallBack];
}


#pragma mark -- 活动界面

+ (void)requestActivityInfo:(SuccessCallBack)successCallBack error:(ErrorCallBlck)errorCallBack {
    NSString *url = @"index.php?act=appsettings&op=activity_address";
    NSDictionary *dic = @{};
    [self GET:url parameters:dic success:successCallBack error:errorCallBack];
}

#pragma mark --  APP版本

+ (void)requestAppVesion:(SuccessCallBack)successCallBack error:(ErrorCallBlck)errorCallBack {
    NSString *url = @"index.php?act=appsettings&op=app_version";
    NSDictionary *dic = @{@"apptype":@"ios"};
    [self GET:url parameters:dic success:successCallBack error:errorCallBack];
}



































@end
